<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-model测试</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>

<body>
    <div id="aaa">
        <h1>绑定下拉框</h1>
        民族
        <select v-model="user.minzu">
            <option disabled value="">请选择</option>
            <option v-for="item in minzus" :value="item">
                {{item.name}}
            </option>
        </select>
        {{user}}
    </div>
    <script>
        const vm = new Vue({
            el: "#aaa",
            data() {
                return {
                    user: {
                        username: "张三",
                        password: "qwe",
                        minzu: ""
                    },
                    minzus: [
                        { id: 1, name: "汉族" },
                        { id: 2, name: "朝鲜族" },
                        { id: 3, name: "白族" },
                        { id: 4, name: "回族" },
                        { id: 5, name: "藏族" },
                        { id: 6, name: "羌族" },
                    ]
                };
            },
        })
    </script>
</body>

</html>